-
-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix memory leak issue in SentryFlutterPlugin #1588
Conversation
I fixed the memory leak issue in SentryFlutterPlugin by removing the anonymous inner class that was holding a reference to the external SentryFlutterPlugin object, which was causing a memory leak problem with the MethodChannel object.
We are currently adding tests #1587 |
@linkaipeng thanks for the PR. I'm not sure the suggested changes will have any effect, the leak seems to be in https://github.com/getsentry/sentry-java/blob/549cbb4657b9dea1048c4882e79504e87d6acc4f/sentry-android-core/src/main/java/io/sentry/android/core/ScreenshotEventProcessor.java#L26 (based on the SS) The changes with the Can you elaborate on what exactly is causing this, which line, etc? @romtsn or @markushi can chime in as well since they own this part of the code. |
What is |
Hm, found this, looks very similar ryanheise/audio_session#12. Should we nullify the |
@marandaneto Thank you for your reply. The reason is that the The approach I took was to completely decouple the After modification: Another way to modify is to make the |
Oh I see, that makes sense @linkaipeng thanks for the explanation. |
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #1588 +/- ##
==========================================
+ Coverage 88.44% 88.68% +0.23%
==========================================
Files 132 124 -8
Lines 4274 3940 -334
==========================================
- Hits 3780 3494 -286
+ Misses 494 446 -48 ☔ View full report in Codecov by Sentry. |
Update changelog getsentry#1588
Thank you. The changelog has been committed. |
the lining issues:
|
Fix some lining issues for SentryFlutterPlugin.
Fixed. |
I fixed the memory leak issue in SentryFlutterPlugin by removing the anonymous inner class that was holding a reference to the external SentryFlutterPlugin object, which was causing a memory leak problem with the MethodChannel object.
📜 Description
💡 Motivation and Context
To reproduce the steps:
💚 How did you test it?
Since the SentryFlutterPlugin does not have unit test code, I repeated the steps mentioned above after making the modifications and confirmed that the issue has been fixed.
📝 Checklist
sendDefaultPii
is enabled🔮 Next steps